package com.support.android.myapp3.acitivty;

import android.os.Bundle;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.StaggeredGridLayoutManager;

import com.support.android.myapp3.R;
import com.support.android.myapp3.adapter.RecycleAdapter1;

import java.util.ArrayList;

public class RecycleCardActivity extends BaseActionExActivity {


    @Override
    public int getLayoutView() {
        return R.layout.activity_recycle1;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        RecyclerView rv = (RecyclerView)findViewById(R.id.recycleview1);
        LinearLayoutManager layoutManager= new LinearLayoutManager(this);
//        LinearLayoutManager layoutManager= new LinearLayoutManager(this,LinearLayoutManager.HORIZONTAL,true);
//        GridLayoutManager layoutManager=new GridLayoutManager(this,3);
//        StaggeredGridLayoutManager layoutManager = new StaggeredGridLayoutManager(3, StaggeredGridLayoutManager.VERTICAL);
        rv.setLayoutManager(layoutManager);
        rv.setAdapter(new RecycleAdapter1(this,inintList()));

    }


    public ArrayList inintList() {
        ArrayList<ArrayList> list = new ArrayList<ArrayList>();
        for (int i=0;i<20;++i) {
            list.add(inintmLis("这里是CardView "+i, "炫酷的效果嗨起来", R.mipmap.ic_launcher));
        }

//        list.add(inintmLis("这里是CardView 1", "炫酷的效果嗨起来", R.mipmap.ic_launcher));
//        list.add(inintmLis("这里是CardView 2", "炫酷的效果嗨起来", R.mipmap.ic_launcher));
//        list.add(inintmLis("这里是CardView 3", "炫酷的效果嗨起来", R.mipmap.ic_launcher));
//        list.add(inintmLis("这里是CardView 4", "炫酷的效果嗨起来", R.mipmap.ic_launcher));
//        list.add(inintmLis("这里是CardView 5", "炫酷的效果嗨起来", R.mipmap.ic_launcher));
//        list.add(inintmLis("这里是CardView 6", "炫酷的效果嗨起来", R.mipmap.ic_launcher));
//        list.add(inintmLis("这里是CardView 7", "炫酷的效果嗨起来", R.mipmap.ic_launcher));
//        list.add(inintmLis("这里是CardView 8", "炫酷的效果嗨起来", R.mipmap.ic_launcher));
//        list.add(inintmLis("这里是CardView 9", "炫酷的效果嗨起来", R.mipmap.ic_launcher));
//        list.add(inintmLis("这里是CardView 10", "炫酷的效果嗨起来", R.mipmap.ic_launcher));
//        list.add(inintmLis("这里是CardView 11", "炫酷的效果嗨起来", R.mipmap.ic_launcher));
//        list.add(inintmLis("这里是CardView 12", "炫酷的效果嗨起来", R.mipmap.ic_launcher));
//        list.add(inintmLis("这里是CardView 13", "炫酷的效果嗨起来", R.mipmap.ic_launcher));
//        list.add(inintmLis("这里是CardView 14", "炫酷的效果嗨起来", R.mipmap.ic_launcher));
//        list.add(inintmLis("这里是CardView 15", "炫酷的效果嗨起来", R.mipmap.ic_launcher));
//        list.add(inintmLis("这里是CardView 16", "炫酷的效果嗨起来", R.mipmap.ic_launcher));
//        list.add(inintmLis("这里是CardView 17", "炫酷的效果嗨起来", R.mipmap.ic_launcher));
//        list.add(inintmLis("这里是CardView 18", "炫酷的效果嗨起来", R.mipmap.ic_launcher));
//        list.add(inintmLis("这里是CardView 19", "炫酷的效果嗨起来", R.mipmap.ic_launcher));
//        list.add(inintmLis("这里是CardView 20", "炫酷的效果嗨起来", R.mipmap.ic_launcher));
//        list.add(inintmLis("这里是CardView 21", "炫酷的效果嗨起来", R.mipmap.ic_launcher));
        return list;
    }


    private ArrayList inintmLis(String str1, String str2, int s) {
        ArrayList list1 = new ArrayList();
        list1.add(str1);
        list1.add(str2);
        list1.add(s);
        return list1;
    }

}
